﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class UILoad : MonoBehaviour
{
    private Slider prograssBar;

    private void Awake()
    {
        Init();
    }

    /// <summary>
    /// 初始化UILoad
    /// </summary>
    private void Init()
    {
        EventCenter.AddListener<float>(CL.EventType.SetPrograssBar, SetPrograss);

        prograssBar = transform.Find("Bottom/PrograssBar").GetComponent<Slider>();        
    }

    private void OnDestroy()
    {
        EventCenter.RemoveListener<float>(CL.EventType.SetPrograssBar, SetPrograss);
    }


    public void SetPrograss(float num)
    {
        prograssBar.value = num;
    }
}